-module(stress_test).

-export([start/0, tests/1]).

start() ->
    tests(12354).

tests(Port) ->
    io:format("starting~n"),
    spawn(fun() -> test(Port) end),
    spawn(fun() -> test(Port) end),
    spawn(fun() -> test(Port) end),
    spawn(fun() -> test(Port) end).

test(Port) ->
    case gen_tcp:connect("127.0.0.1", Port, [binary,{packet, 0}]) of
        {ok, _Socket} ->
            test(Port);
        _ ->
            test(Port)
    end.
